(function () {
    'use strict';
    angular.module('module.record-system')
        .controller('RecordSystemUpdateController', RecordSystemUpdateController);
    RecordSystemUpdateController.$inject = ['$rootScope', '$scope', '$filter', '$uibModal', '$http', '$state','$uibModalInstance', 'i18nService'];

    function RecordSystemUpdateController($rootScope, $scope, $filter, $uibModal, $http, $state, $uibModalInstance, i18nService) {
        var vm = $scope;
        vm.activate = activate;     //初始化
        vm.cancel = cancel;//关闭弹窗
        vm.update = update;//保存

        activate();
        return vm;

        function activate() {
        }
        /**
         * 保存
         */
        function update() {
            swal({
                title: '确认更新备案系统信息?',
                type: 'info',
                showCancelButton: true,
                confirmButtonColor: '#3085d6',
                cancelButtonColor: '#d33',
                confirmButtonText: '确认!',
                cancelButtonText: '取消!',
                confirmButtonClass: 'btn btn-success margin-right-10',
                cancelButtonClass: 'btn btn-primary',
                buttonsStyling: false
            }).then(function () {
                swal({
                    title: '提示！',
                    text: '更新成功!',
                    closeOnConfirm: true,
                    type: 'success'
                }).then(function(){
                    cancel();
                });
            });
        }
        /**
         * 关闭弹窗
         */
        function cancel() {
            $uibModalInstance.dismiss('cancel');
        }
    }
})();